import Relay from "react-relay";

export default class CreateEnterpriseMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { createEnterprise }`;
    }

    getVariables() {
        return {
            argsInput: {
                enterpriseId:this.props.enterpriseId,
                userId:this.props.userId,
                enterpriseName:this.props.enterpriseName,
                enterpriseCode:this.props.enterpriseCode,
                entype:this.props.entype,
                countryType:this.props.countryType,
                province:this.props.province,
                city:this.props.city,
                region:this.props.region,
                address:this.props.address,
                telephone:this.props.telephone,
                bankAccount:this.props.bankAccount,
                bankName:this.props.bankName,
                taxpayerNo:this.props.taxpayerNo,
                bankNo:this.props.bankNo,
                remark:this.props.remark,
                userName:this.props.userName,
                userPhone:this.props.userPhone,
                serviceType:this.props.serviceType,
                mainService:this.props.mainService,

            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on createEnterprisePayload {
            data {
                errorCode
                value
                token
                totalResult
                id
                enterprise{
                   city
                   enterpriseName
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
               fragment on createEnterprisePayload {
            data {
                errorCode
                value
                totalResult
                id
                enterprise{
                   city
                   enterpriseName
                }
                }
                }
            `]
        }];
    }

}